<script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
<div class="section">
	<div class="login-in">
		<div class="login-info">
			<div class="form">
				<div class="am-tabs" data-am-tabs="{noSwipe: 1}" id="doc-tab-demo-1">
				  	<ul class="am-tabs-nav am-nav am-nav-tabs">
				    	<li class="am-active"><a href="javascript: void(0)">微信登录</a></li>
				    	<li><a href="javascript: void(0)">密码登录</a></li>
				  	</ul>
				  	<div class="am-tabs-bd">
				     	<div class="am-tab-panel am-active ">
				     		<div id="login_container" class="login_container"></div>
				    	</div>
				    <div class="am-tab-panel">
				      	<form id="my-form" action="/index/passport/login">
								<div class="input">
									<i class="am-icon-user"></i>
									<input type="text" name="data[user_name]" value="test" placeholder="请输入账号" required>
								</div>
								<div class="input">
									<i class="am-icon-lock"></i>
									<input type="password" name="data[password]" value="test" placeholder="请输入密码" required>
								</div>
								<div style="padding:20px 0px;">
    								<div class="w50">
    									<i class="am-icon-shield"></i>
    									<input type="text" name="data[captcha]" value="" placeholder="请输入验证码" required>
    								</div>
    								<div class="captcha">
                                        <img src="{:url('passport/captcha')}" alt="验证码" onclick="this.src='{:url('passport/captcha')}?r='+Math.random()" />
                                    </div>
                                </div>
                                <div style="height:20px;"></div>
								<button class="j-submit layui-btn sub-btn" type="submit">登录</button>
							</form>
							<div class="login-nav">
								<span class="login">找回账号密码：官方公众号回复 “<a>找回账号</a>”</span>
								<span class="login">我还没有账号？微信直接扫码</span>
							</div>
				    </div>
				</div>

			</div>
		</div>
	</div>
</div>
<script>
	var obj = new WxLogin({
		id: "login_container",
		appid: "{$app_id}",
		scope: "snsapi_login",
		redirect_uri: encodeURIComponent("{$base_url}index/passport/wxlogin"), 
		state: Math.ceil(Math.random()*1000),
		style: "black",
		href: "data:text/css;base64,QGNoYXJzZXQgIlVURi04IjsKLmltcG93ZXJCb3ggLnFyY29kZSB7d2lkdGg6IDI4MHB4O30KLmltcG93ZXJCb3ggLnRpdGxlIHtkaXNwbGF5OiBub25lO30KLmltcG93ZXJCb3ggLmluZm8ge3dpZHRoOiAyODBweDt9Ci5zdGF0dXNfaWNvbiB7ZGlzcGxheTogbm9uZX0KLmltcG93ZXJCb3ggLnN0YXR1cyB7dGV4dC1hbGlnbjogY2VudGVyO30g"
	});

	$(function () {

        $('#my-form').formPost();

    });
</script>
